//package com.yy.studyspringboot.utils;
//
//import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
//import org.springframework.beans.factory.config.BeanDefinition;
//import org.springframework.beans.factory.support.BeanDefinitionRegistry;
//import org.springframework.context.annotation.AnnotationBeanNameGenerator;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.util.StringUtils;
//
///**
// * 参考：https://blog.csdn.net/liu_xue_xue/article/details/106047967?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.fixedcolumn&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.fixedcolumn
// */
//public class UniqueNameGenerator extends AnnotationBeanNameGenerator {
//
//    @Override
//    public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
//
//        //如果有设置了value，则用value，如果没有则是用全类名
//        if (definition instanceof AnnotatedBeanDefinition) {
//            String beanName = determineBeanNameFromAnnotation((AnnotatedBeanDefinition) definition);
//            if (StringUtils.hasText(beanName)) {
//                // Explicit bean name found.
//                return beanName;
//            }else{
//                //全限定类名
//                beanName = definition.getBeanClassName();
//                return beanName;
//            }
//        }
//
//        // 使用默认类名
//        return buildDefaultBeanName(definition, registry);
//    }
//}